home *** CD-ROM | disk | FTP | other *** search
- KBFIX2.COM VERSION 2.3 June 18, 1985
-
-
-
- Copyright (C) 1985
- Skip Gilbrech
-
- ----------------------------------------------
- This program is intended for public-domain use
- It must not be sold under any condition
- ----------------------------------------------
-
- INTRODUCTION
-
- KBFIX2.COM is an extensively modified and enhanced version of an
- earlier program, KBFIX.COM. The main purpose of that program was
- to display the status of the caps-, num-, and scroll-lock keys on
- the IBM-PC video screen, while providing an audible signal in the
- form of a low-to-high or high-to-low beep each time the status
- changed. KBFIX also provided a 127-character keyboard buffer to
- replace the 15-character standard buffer.
-
- KBFIX had only two options, however: it could be installed with
- or without the buffer, and even that choice could be made only
- the first time the program was invoked. Several people mentioned
- that they'd prefer to get rid of the beep, and others wanted the
- key-status display to appear at a different screen location,
- and/or not to disappear each time the screen was scrolled up a
- line. In addition, the method I chose to implement the enlarged
- buffer made KBFIX incompatible with several popular programs:
- PROKEY wouldn't work properly, nor would any program that assumed
- the buffer was in its normal location. It was to address these
- suggestions and problems that I started to write KBFIX2.
-
- While I was working on the timer interrupt routine for the key-
- status display update, it occurred to me that it would be rela-
- tively easy to include an option to adjust keyboard typematic
- rate. There is a popular public-domain program, SPEEDKEY, that
- already does just that, but since it relies on specific bios-rom
- versions and addresses it can't be used on any machine it doesn't
- know about, no matter how otherwise compatible the machine might
- be. It also, like the older version of KBFIX, has a few compati-
- bility problems with other programs. So I decided to include a
- typematic adjustment option to KBFIX2. The method used, by the
- way, seems to work fine with the PC/AT, even though it's possible
- to adjust the typematic rate on that machine by sending a command
- directly to the keyboard.
-
- (added for version 2.1)
- By popular demand(!), KBFIX2 now can be set to pause if the
- scroll-lock key is pressed. The scroll-lock key can always be
- used normally (to shift the scroll-state) by depressing a shift
- key (Right/Left Shift or Alt) at the same time. See the 'S'
- option below.
-
-
-
-
-
-
- -- 1 --
-
-
-
-
-
- KBFIX2.COM VERSION 2.3 June 18, 1985
-
-
- USING THE PROGRAM
-
- KBFIX2 can be invoked from the command line or from within a
- batch file. The first time the program is invoked it loads
- itself into memory (takes up about 2K); it will then remain
- resident until the system is rebooted. The current configuration
- of KBFIX2 is selected by means of the command line options out-
- lined below, any or all of which can be changed at any time.
- When the program starts up, it tries to find its loaded image in
- memory; if the image is found, all options currently in effect
- are copied to a local buffer where they are used as defaults, and
- all changes will be made to the memory-resident image. KBFIX2
- will never knowingly load more than one copy of itself into
- memory, so if you ever see the 'Initial Installation' message
- after KBFIX2 has once been loaded, please reboot and let me know
- about it.
-
- Options can be entered separately or in groups. Each option or
- group must be preceeded by '-' or '/', and must be separated from
- other groups by at least one space or tab. There must be no
- spaces within groups. To enable or disable an 'on/off' option,
- follow the letter(s) with 1 or 0.
-
- OPTION DEFAULT
- ------ -------
-
- KB -- use extended Keyboard Buffer Enabled
-
- Enabling this option activates the 127-character keyboard
- buffer. It also allows KBFIX2 to check for the special
- characters Ctrl-C, Ctrl-S, and Ctrl-P, which are normally
- only recognized by DOS if they appear at the beginning of
- the keyboard buffer. If any one of these characters is
- typed while KBFIX2's buffer is active, the buffer will be
- cleared, and the character typed will be placed at its head.
-
- KT -- adjust Typematic action of Keys Disabled
-
- Enabling this option allows adjusting the speed of typematic
- key repeating; disabling it returns typematic action to
- normal. The options below that start with 'KT' will retain
- their settings even if typematic is disabled, so it's not
- necessary to reenter them if it becomes necessary to shut
- off typematic temporarily.
-
-
-
-
-
-
-
-
-
-
-
-
-
- -- 2 --
-
-
-
-
-
- KBFIX2.COM VERSION 2.3 June 18, 1985
-
-
- OPTION DEFAULT
- ------ -------
-
- KTD -- Ticks to Delay before starting (0-99) 6
-
- Sets the number of timer ticks which will occur before
- typematic repeating begins. Timer ticks happen approximate-
- ly once every 1/18th second, so if this number is larger
- than about 9, the only effect it will have is a speedup of
- the typematic rate of an already repeating key, since normal
- typematic action seems to start (on an IBM-PC, at least)
- about one-half second after the key is first pressed. Per-
- sonally I find a setting of 5 or 6 about right.
-
- KTR -- Ticks between key Repeats (0-99) 0
-
- Sets the number of timer ticks which will occur between
- repeats of the currently-pressed key. Setting this option
- to zero results in 18 repeats per second. These repeats are
- in addition to the normal typematic repeats produced by the
- keyboard, so the effective rate of repeating will be consid-
- erably higher than the setting of this option would other-
- wise indicate.
-
- KTN -- Num. chars. inserted each repeat (1-10) 1
-
- Determines how many copies of the currently repeating key-
- code to place into the keyboard buffer each time the key is
- repeated. Fine tuning of the effective typematic rate is
- possible by experimenting with various combinations of this
- setting and the KTR setting above.
-
- F -- Fix caps-lock reverse character shift Enabled
-
- Tells KBFIX2 whether or not to fix the annoying 'reverse-
- shift' which occurs when caps-lock is on and a shift key is
- pressed. When I have caps-lock on, it's generally because I
- want capital letters to appear on the screen, and that's
- what will happen when this option is enabled.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -- 3 --
-
-
-
-
-
- KBFIX2.COM VERSION 2.3 June 18, 1985
-
-
- OPTION DEFAULT
- ------ -------
-
- D -- Display state of locking keys Enabled
-
- Enabling this option results in an on-screen display of the
- state of the caps-lock, num-lock, and scroll-lock toggles.
- The flags are initially set to display in normal-intensity
- reverse-video. If you're familiar with patching files,
- though, you can change the characters displayed, and their
- attributes, by modifying the following 16-bit words in a
- copy of KBFIX2.COM, then rebooting and reinstalling the
- program. Locations are in hex, relative to the beginning of
- the file (add 100H if using a debugger rather than a file
- patching program):
-
- Offset Used For: Hex value of Char/Attr
-
- 10H Blanking Character 0720H (normal blank)
- 12H Caps-Lock Flag 7043H (reverse 'C')
- 14H Num-Lock Flag 704EH (reverse 'N')
- 16H Scroll-Lock Flag 7053H (reverse 'S')
-
- C -- starting Column for display (0-77) 77
-
- Sets the starting screen column for the 3-character flag
- display.
-
- R -- Row for display (0-24) 0
-
- Sets the row for the flag display. If the row setting is
- other than 0, the flags will 'clone' themselves whenever the
- screen is scrolled.
-
- T -- use Timer interrupt to update display Disabled
-
- Enabling this option tells KBFIX2 to update the flag display
- 18 times per second by using the user-timer interrupt;
- disabling it means the flags will only be updated whenever a
- key is pressed. Use of this feature allows the flags to be
- seen in programs which would otherwise overwrite them be-
- tween keypresses, but it also slows down the entire system
- slightly due to the overhead involved in writing to the
- screen. The slow-down seems to be less than one percent,
- though, even when using a color monitor. This option can't
- be enabled unless the D option above is also enabled.
-
- B -- Beep when locking keys are toggled Enabled
-
- Determines whether the bell will sound whenever the state of
- one of the toggling keys changes. If this option is ena-
- bled, the machine will beep from low to high whenever a
- toggle changes from off to on, and from high to low whenever
- a toggle changes from on to off.
-
-
-
- -- 4 --
-
-
-
-
-
- KBFIX2.COM VERSION 2.3 June 18, 1985
-
-
- OPTION DEFAULT
- ------ -------
-
- S -- Scroll lock pause control (Version 2.2) Disabled
-
- Enabling this option will make KBFIX2 enter a loop whenever
- the scroll-lock key is pressed. The loop will cause screen
- output, and any other non interrupt-driven activity, to
- pause until the next time scroll-lock is pressed (either by
- itself, or at the same time as shift key). The scroll-lock
- key can always be used normally (to shift the scroll-state)
- by holding a shift key (Right/Left Shift or Alt) down at the
- same time. If the D option is enabled, a blinking S will be
- displayed while the pause is in effect.
-
- V -- Verbose display of current settings Enabled
-
- Disabling this option prevents KBFIX2 from presenting its
- normal display of current settings. To have any effect,
- this option must be specified each time KBFIX2 is invoked.
-
- -----------------------------------------------------------
-
- Example: KBFIX2 /F0 /KT1 /KTD5 /D1 /T1 /C50 /R0 /B0 /V0
-
- disables the caps-lock fix, enables typematic adjustment,
- sets the type-matic delay (before starting to repeat a
- pressed key) to 5 ticks (5/18ths of a second), enables the
- key-state display and timer update, sets the display column
- and row to 50/0, disables toggle beeps, and tells KBFIX2 not
- to display its current settings.
-
- To avoid having to remember all this, enter your normal para-
- meters in AUTOEXEC.BAT or in some other convenient batch file.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -- 5 --
-
-
-
-
-
- KBFIX2.COM VERSION 2.3 June 18, 1985
-
-
- HARDWARE COMPATIBILITY
-
- KBFIX2 should run on any IBM-PC, XT, or AT, and on most close
- compatibles. Following are some of the assumptions it makes
- about the hardware:
-
- 1) The screen memory starts at B000H (monochrome), and B800H
- (color); screen-related bios data locations are identical to
- those on the IBM-PC.
-
- 2) The keyboard buffer starts at 40:1E and is organized like
- the standard IBM-PC buffer.
-
- 3) The base port address of the 8259 interrupt controller is
- 20H; the timer interrupt is on IRQ0, set up as interrupt 8;
- the keyboard interrupt is on IRQ1 and is interrupt 9.
-
- 4) The base keyboard port address is 60H.
-
- 5) The bios calls a user-timer routine (interrupt 1CH) approxi-
- mately 18 times per second.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -- 6 --
-
-
-
-
-
- KBFIX2.COM VERSION 2.3 June 18, 1985
-
-
- SOFTWARE COMPATIBILITY
-
- No program that deals with the hardware and system software on
- this level can hope to be compatible with everything else.
- KBFIX2 appears to work perfectly well with Sidekick, Dosedit,
- Prokey, Util (which places characters directly in the buffer),
- and every other program I've tried so far. It also works well
- with Fansi-Console (replacement for Ansi.sys) if KBFIX2's buffer
- option is disabled, since Fansi provides its own enlarged
- keyboard buffer.
-
- I can offer, however, absolutely no guarantees. I would like to
- be informed, though, at the address below, of any incompatibil-
- ities found, so I can try to determine whether the incompatibil-
- ity results from a problem within KBFIX2. Before you decide that
- KBFIX2 is incompatible with something, by the way, try varying
- loading order, removing other resident programs, changing op-
- tions, etc. I've tried to give KBFIX2 as 'low a profile' as
- possible. What I mean by that is that the interrupt handlers in
- KBFIX2 always pass control to whatever was there before, without
- changing the machine state at all. That feature is useful,
- though, only when KBFIX2 is loaded last in the chain of interrupt
- handlers. KBFIX2 constantly checks the keyboard buffer to deter-
- mine whether another program has changed it, and if so, it defers
- to that program, resets its own buffer and variables, and uses
- the current buffer condition as a starting point for further
- processing. KBFIX2 cannot, however, control what other programs
- do.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -- 7 --
-
-
-
-
-
- KBFIX2.COM VERSION 2.3 June 18, 1985
-
-
- CHANGES
-
- V2.3 (6/18/85): Fixed bug which resulted in the scroll-lock key
- behaving like a typematic key.
-
- V2.2 (3/31/85): Fixed bug in buffer logic which put the wrong
- character in the bios keyboard buffer when the
- extended buffer option was in effect, and char-
- acters were being typed slightly faster than
- they were removed from the buffer (thanks to
- Dave Rothman and Chris Dunford for reporting
- this).
-
- Changed format of current options display to be
- consistent with actual setting of command-line
- switches (thanks to Earle Robinson for the sug-
- gestion).
-
- Changed scroll-lock pause to release only when
- the scroll-lock key is pressed again. If the
- status display is active, a blinking S will
- display while the pause is in effect.
-
- V2.1 (3/18/85): Added scroll-lock pause feature ('s' option).
-
- V2.0 (3/16/85): Original version described in this
- documentation.
-
- Please direct all questions, suggestions and problem reports to:
-
- Skip Gilbrech
- 90 Lexington Ave. #10-G
- New York, NY 10016
- Compuserve: 71445,534 (messages left on PCS-131 preferred)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -- 8 --
-
-
-
-
-